package com.djx.entity.access;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Entity
@Data
@Table(name = "t_permission")
@NoArgsConstructor
public class Permission implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    /**
     * 权限id
     */
    @Column(name = "id")
    private String id;

    /**
     * 权限名称
     */
    @Column(name = "permission_name")
    private String permissionName;

    /**
     * 权限编码
     */
    @Column(name = "permission_code")
    private String permissionCode;

    /**
     * 权限类型 1 为菜单 2 为功能 3 为api
     */
    @Column(name = "permission_type")
    private Integer permissionType;


    /**
     * 父级ID
     */
    @Column(name = "pid")
    private String pid;

    /**
     * 权限描述
     */
    @Column(name = "permission_description")
    private String permissionDescription;

    /**
     * 最后操作时间
     */
    @Column(name = "modify_time")
    private Date modifyTime;


    /**
     * 是否删除 0 正常 1 删除
     */
    @Column(name = "is_delete")
    private Integer isDelete;


    public Permission(String permissionName, Integer permissionType, String permissionCode, String permissionDescription) {
        this.permissionName = permissionName;
        this.permissionType = permissionType;
        this.permissionCode = permissionCode;
        this.permissionDescription = permissionDescription;
    }

}
